<template>
  <div class="homework">
    <ul>
      <li><b>作业名称：</b> {{ row.name || '暂无数据' }}</li>
      <li><b>作业说明：</b>{{ row.content || '暂无数据' }}</li>
      <li>
        <b>作业下载：</b>
        <span>{{ resource.oldName }}</span>
        <el-button
          type="primary"
          size="small"
          icon="el-icon-download"
          @click="handleDownload"
          plain
          >下载</el-button
        >
        <el-button
          type="success"
          size="small"
          icon="el-icon-view"
          @click="handlePreview"
          plain
          >预览</el-button
        >
      </li>
    </ul>
    <!-- <Preview /> -->
  </div>
</template>
<script>
import download from '@/mixins/download'
export default {
  mixins: [download],
  components: {
    // Preview: () => import('../../../netDisk/preview/index.vue'),
  },
  data() {
    return {}
  },
  props: ['row', 'resource'],
  mounted() {},
  methods: {
    handleDownload() {
      let { id, oldName } = this.resource
      this.downloadCall(id, oldName)
    },
    handlePreview() {
      this.$bus.$emit('showPreview', this.resource)
    },
  },
}
</script>
<style scoped lang="scss">
.homework {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: #f5f5f5;
  ul {
    padding: 50px 100px;
    li {
      padding: 10px 0;
      font-size: 16px;
      span {
        color: #999;
        margin-right: 20px;
      }
    }
  }
}
</style>